<html>
<head> </head>
<body>
<script>
'use strict'
function show(a){
	return a++;
}
console.log(show());//NaN   
console.log(show(' '));//0 
console.log(show('1'));//1  string
console.log(show(1));//1  num|

console.log(1+"2");//12 string
var temp,arr=[15,45,7856,2,7,3];

for(var i=0;i<arr.length;i++){
	for(var j=arr.length-1;i<j;j--){
			if(arr[j]>arr[j-1]){
			 temp = arr[j];
			arr[j]=arr[j-1];
			arr[j-1]=temp;
			}
	}
}
function People(name,job,desc){
	this.name=name;
	this.job=job;
	this.desc=desc;
}
//不传name那么，name=undefined
People.prototype={
	constructor:People,
	name:'我是Prototype',
	job:'暂无工作',
	desc:'卖萌的Timo',
	display:function(){
		console.log(this.name);
	}
}
//constructor 永远都是指向构造该对象的构造函数
//js里一切都是对象，每个对象都会有自己的构造函数
//一个函数对象创建的时候，会被自动添加prototype指向这个函数的原型对象。
//实例中的指针仅指向原型，而不指向构造函数
var people1=new People('tom');
var people2=new People("刘吕荣","前端");
//console.log(people1.constructor == People.prototype.constructor);//我们
//console.log(People.prototype.constructor==People);
//people1.display();
//var a="a";
//console.log(a.__proto__);


console.log("job" in people2);//true
//delete people1.name;
for(var key in people1){
console.log(people1[key]);
}
function test(){
}
console.log(Object.keys(People.prototype));//[display,name,job,desc]
console.log(Object.keys(people1));//[name,job,desc]
people1.display();
console.log(Function.constructor);//{}
console.log('people.prototype',People.prototype);//object<= new Object();
console.log('Object.constructor',Object.constructor);
console.log(String.constructor===Object.constructor);
console.log("Array.constructor",Array.constructor);
</script>
</body>
</html>